package com.laoxu.java.ms.service;

import com.laoxu.java.ms.hystrix.UserClientFallback;
import com.laoxu.java.ms.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "user-service",path = "user-service",fallback = UserClientFallback.class)
public interface UserClient {
    /**
     * <h2>通过 OpenFeign 访问 user-service 获取用户列表</h2>
     * */
    @GetMapping(value = "/users")
    List<User> getUsers();

    @GetMapping(value = "/user/{id}")
    User getUserById(@PathVariable("id") Integer id);
}
